package com.qd.common.panda.domain.entity.msg;

import com.cdqidi.util.page.BaseQuery;
import com.cdqidi.valid.group.DefaultGroup;
import com.cdqidi.valid.group.DeleteGroup;
import com.cdqidi.valid.group.UpdateGroup;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.time.LocalDateTime;

/**
 * 我的消息
 *
 * @author sjk
 */
@EqualsAndHashCode(callSuper = true)
@Getter
@Setter
public class UserMsgDTO extends BaseQuery {

    /**
     * 主键
     */
    @NotBlank(message = "消息ID不能为空", groups = {DeleteGroup.class, UpdateGroup.class})
    @Size(max = 50, message = "消息ID长度不能超过{max}位", groups = {DeleteGroup.class, UpdateGroup.class})
    private String msgId;
    /**
     * 消息内容
     */
    @NotBlank(message = "消息内容不能为空", groups = DefaultGroup.class)
    @Size(max = 200, message = "消息内容长度不能超过{max}位", groups = DefaultGroup.class)
    private String note;
    /**
     * 添加时间
     */
    @NotNull(message = "添加时间不能为空", groups = DefaultGroup.class)
    private LocalDateTime addTime;
    /**
     * 业务ID
     */
    @Size(max = 50, message = "业务ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String bid;
    /**
     * 是否已读:0未读1已读
     */
    @NotNull(message = "是否已读:0未读1已读不能为空", groups = DefaultGroup.class)
    private Integer canRead;
    /**
     * 消息类型
     */
    @NotBlank(message = "消息类型不能为空", groups = DefaultGroup.class)
    @Size(max = 20, message = "消息类型长度不能超过{max}位", groups = DefaultGroup.class)
    private String msgType;
    /**
     * 消息类型显示
     */
    private String msgTypeDisplay;
    /**
     * 用户ID
     */
    @NotBlank(message = "用户ID不能为空", groups = DefaultGroup.class)
    @Size(max = 50, message = "用户ID长度不能超过{max}位", groups = DefaultGroup.class)
    private String userId;

    @Override
    public void freeData() {
        this.msgId = null;
        this.note = null;
        this.addTime = null;
        this.bid = null;
        this.canRead = null;
        this.msgType = null;
        this.userId = null;
        this.msgTypeDisplay = null;
        super.freeData();
    }
}
